package com.kingre.et.dao.jpa;

import java.util.List;

import com.kingre.et.Constants;
import com.kingre.et.dao.IQuestionnaireDAO;
import com.kingre.et.model.Questionnaire;

public class QuestionnaireDAOJPA extends GenericDAOJPA<Questionnaire, Integer> implements IQuestionnaireDAO {

	@SuppressWarnings("unchecked")
	public List<Questionnaire> getQuestionOfPage(int page) {
        return getJpaTemplate().find(
                "FROM Questionnaire p WHERE id BETWEEN ? AND ? ORDER BY id", (page - 1) * Constants.COUNT_PAGE + 1, page * Constants.COUNT_PAGE);
	}

}
